<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Vue示例</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/vue/3.2.40/vue.global.js"></script>
  </head>
  <body>
    <div id="app">
      <input type="text" v-model="message" />
      <p>{{message}}</p>
      <hr>
      <select v-model="selected">
        <option v-for="item,index in options" :key="index" :value="item.value">
            {{item.value}}
        </option>
      </select>
      <button @click="myClick">点击</button>
      <p>{{selected}}</p>
    </div>
    <script>
      const app = Vue.createApp({
        data() {
          return {
            message: "guidian",
            selected:'abc',  //不声明也可以
            options: [
              { text: "One", value: "A" },
              { text: "Two", value: "B" },
              { text: "Three", value: "C" },
            ],
          };
        },
        methods: {
            myClick(){
                console.log(this.options);
            }
        },
        computed: {},
        watch: {},
      }).mount("#app");
    </script>
  </body>
</html>
